package handlers

import (
	"fmt"
	"gin-kitex-gorm/api/rpc"
	"gin-kitex-gorm/kitex_gen/user"
	"github.com/gin-gonic/gin"
)

func Register(c *gin.Context) {
	username := c.Query("username")
	password := c.Query("password")

	resp, err := rpc.Register(c, &user.UserRegisterRequest{
		Username: username,
		Password: password,
	})

	if err != nil {
		fmt.Println("Sth bad happened!!!")
	}

	Response(c, resp)
}
